<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php $this->load->view('include/html_head')?>
</head>
<body>
<div id="wrapper">
	<?php $this->load->view('include/header')?>
	<?php $this->load->view('include/menu')?>
	<div id="page">
		<div id="content">
		<?php $this->load->view('include/sub_navi')?>
			<div class="post">
				<p class="meta">社联新闻 - News of Association</p>
				<div class="entry">
					<?php if (!empty($association_news)):?>
				  	<table class='full'>
				  	<?php 
				  	$sort_create_time_title = '发布时间由远到近排列';  //默认：正向排序
				  	$sort_create_time_link = 1;
				  	
				  	$sort_view_count_title = '按浏览次数由高到低排列';  //默认：反向排序
				  	$sort_view_count_link = 3;
				  	
				  	if ($param == 1 || $param == 2) {
				  		if ($param == 1) {
				  			$sort_create_time_title = '发布时间由近到远排列';
				  			$sort_create_time_link = 2;
				  		} else {
				  			$sort_create_time_title = '发布时间由远到近排列';
				  			$sort_create_time_link = 1;
				  		}
				  	}
				  	if ($param == 3 || $param == 4) {
				  		if ($param == 3) {
				  			$sort_view_count_title = '按浏览次数由低到高排列';  //正向
				  			$sort_view_count_link = 4;
				  		} else {
				  			$sort_view_count_title = '按浏览次数由高到低排列';  //反向
				  			$sort_view_count_link = 3;
				  		}
				  	}
				  	
				  	if ($param == 1) {
				  		$sort_create_time_img_link = base_url() . "images/icon/arrow_down.png";
				  	} elseif ($param == 2) {
				  		$sort_create_time_img_link = base_url() . "images/icon/arrow_up.png";
				  	} else {
				  		$sort_create_time_img_link = base_url() . "images/icon/arrow_none.png";
				  	}
				  	if ($param == 3) {
				  		$sort_view_count_img_link = base_url() . "images/icon/arrow_down.png";
				  	} elseif ($param == 4) {
				  		$sort_view_count_img_link = base_url() . "images/icon/arrow_up.png";
				  	} else {
				  		$sort_view_count_img_link = base_url() . "images/icon/arrow_none.png";
				  	}
				  	?>
		  		  	<style type="text/css">
					#sort_create_time{
						background:#E8F4E8 url('<?php echo $sort_create_time_img_link?>') no-repeat 100% 0;
						border:1px solid #9FA49F;
						border-radius: 3px 3px 3px 3px;
						padding:1px;
						padding-right:17px;
					</style>
					<style type="text/css">
					#sort_view_count{
						background:#E8F4E8 url('<?php echo $sort_view_count_img_link?>') no-repeat 100% 0;
						border:1px solid #9FA49F;
						border-radius: 3px 3px 3px 3px;
						padding:1px;
						padding-right:17px;
					</style>
					<thead>
				  		<tr>
				  			<th><a title='社联新闻' href='<?php echo base_url()?>index.php/frontend/association/news_list' >社联新闻</a></th>
							<th style="text-align:center;" ><a id='sort_create_time' title='<?php echo $sort_create_time_title ?>' href="<?php echo base_url()?>index.php/frontend/association/news_list/<?php echo $sort_create_time_link ?>">发布时间</a></th>
							<th style="text-align:center;" ><a id='sort_view_count' title='<?php echo $sort_view_count_title ?>' href="<?php echo base_url()?>index.php/frontend/association/news_list/<?php echo $sort_view_count_link ?>">浏览次数</a></th>
						</tr>
					</thead>
				  		<?php foreach ($association_news as $v):?>
				  	<tbody>
				  		<tr>
		    				<td><a title='<?php echo $v['title']?>' href='<?php echo base_url().'index.php/frontend/association/news_detail/'.$v['id']?>'><?php echo $v['title']?></a></td>
		    				<td style="text-align:center; width:80px;" ><?php echo date("Y-m-d", $v['create_time'])?></td>
		    				<td style="text-align:center; width:80px;" ><?php echo $v['view_count']?></td>
		    			</tr>
		    		</tbody>
				  		<?php endforeach;?>
		    		</table>
		    		<?php echo $this->pagination->create_links(); ?>
					<?php else:?>
					<span class='tip'>抱歉，没有找到相关的结果！请更改查询选项再试试!</span>
					<?php endif;?>
				</div>
			</div>
			<div style="clear: both;">&nbsp;</div>
		</div>
		<!-- end #content -->
		<?php $this->load->view('include/side_bar')?>
		<div style="clear: both;">&nbsp;</div>
	</div>
	<!-- end #page -->
</div>
<?php $this->load->view('include/footer_content')?>
<?php $this->load->view('include/footer')?>
</body>
</html>
